Skip to content

Conversation

@margaree
Copy link
Contributor

Jira task

Adds tests based on suggestions from CoPilot. I did remove the suggested disabled and focus state vdiffs due to prior discussion about how that has overlap with button-icon vdiffs.

@github-actions
Copy link
Contributor

Thanks for the PR! 🎉

We've deployed an automatic preview for this PR - you can see your changes here:

URL https://live.d2l.dev/prs/BrightspaceUI/core/pr-6301/

Note

The build needs to finish before your changes are deployed.
Changes to the PR will automatically update the instance.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@margaree margaree marked this pull request as ready for review November 13, 2025 19:20
@margaree margaree requested a review from a team as a code owner November 13, 2025 19:20

describe('icon state', () => {

it('clears previous timeout on multiple clicks', async() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like a somewhat fragile way to test that clicking the copy button multiple times extends the amount of time before clearing the copied icon. I wonder if we could do a vdiff with a fake timer (so we're not actually waiting 2s) that accomplishes the same thing?

await waitUntil(() => {
const buttonIcon = elem.shadowRoot.querySelector('d2l-button-icon');
return buttonIcon.icon === 'tier1:copy';
}, 'icon did not revert to copy', { timeout: 3000 });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of actually waiting 3s, could we use Sinon's fake time to manually advance the clock?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants